package com.shuai.jit.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shuai.jit.entity.course.Tag;
import com.shuai.jit.service.TagService;
import com.shuai.jit.mapper.TagMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
@Slf4j
public class TagServiceImpl extends ServiceImpl<TagMapper, Tag> implements TagService {


    @Override
    public List<String> getTags(String id) {
        QueryWrapper<Tag> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("pid",id);
        List<Tag> list=this.baseMapper.selectList(queryWrapper);
        List<String> result=new ArrayList<>();
        for (Tag tag:list){
            result.add(tag.getName());
        }
        return result;
    }
}
